#ifndef __RINGBUFFER_H__
#define __RINGBUFFER_H__
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _ringbuffer_t ringbuffer_t;

extern ringbuffer_t *ringbuffer_create(uint16_t size);
extern void ringbuffer_destroy(ringbuffer_t *rb);
extern int ringbuffer_empty(ringbuffer_t *rb);
extern int ringbuffer_full(ringbuffer_t *rb);
extern int ringbuffer_used(ringbuffer_t *rb);
extern int ringbuffer_remain(ringbuffer_t *rb);
extern void ringbuffer_clear(ringbuffer_t *rb);

extern int ringbuffer_put(ringbuffer_t *rb, uint8_t *ptr, int len);
extern int ringbuffer_put_cover(ringbuffer_t *rb, uint8_t *ptr, int len);
extern int ringbuffer_get(ringbuffer_t *rb, uint8_t *ptr, int len);

#ifdef __cplusplus
}
#endif

#endif  // __RINGBUFFER_H__
